package ua.kharkov.photo.controllers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class AbstractController {

	private static final Logger logger = LoggerFactory
			.getLogger(AbstractController.class);

	@ExceptionHandler(Exception.class)
	public ModelAndView handleException(Exception e) {
		logger.info(e.toString());

		ModelAndView modelAndView = new ModelAndView("redirect:/error");
		return modelAndView;
	}
}
